LOCAL_PATH	:=	$(call my-dir)

DIR_SRC	:=	../../../src
DIR_PVM	:=	$(DIR_SRC)/lib

include	$(CLEAR_VARS)

ifeq ($(APP_OPTIM), debug)
DEBUG_SUFFIX := _d
else
DEBUG_SUFFIX := 
endif

LOCAL_MODULE		:=	pvmstatic
LOCAL_MODULE_FILENAME	:=	libpvmstatic$(DEBUG_SUFFIX)
LOCAL_ARM_MODE	:=	arm
LOCAL_SRC_FILES	:=	$(DIR_PVM)/pvmlib.cpp \
										$(DIR_PVM)/pvmlog.cpp \
										$(DIR_PVM)/sys/common/pvmvsprintf_wide.cpp \
										$(DIR_PVM)/pvmdebug.cpp \
										$(DIR_PVM)/memory/pvmmemory.cpp \
										$(DIR_PVM)/memory/dlmalloc.c \
										$(DIR_PVM)/3d/pvm3dsoftware_float.cpp \
										$(DIR_PVM)/3d/XMath.cpp \
										$(DIR_PVM)/decoders/mod/pvmsourcefactorymod.cpp \
										$(DIR_PVM)/decoders/mod/pvmvoicemod.cpp \
										$(DIR_PVM)/decoders/mod/pvmvoicesourcemod.cpp \
										$(DIR_PVM)/decoders/oggvorbis/pvmovdatasource.cpp \
										$(DIR_PVM)/decoders/oggvorbis/pvmsourcefactoryoggvorbis.cpp \
										$(DIR_PVM)/decoders/oggvorbis/pvmvoiceoggvorbis.cpp \
										$(DIR_PVM)/decoders/oggvorbis/pvmvoicesourceoggvorbis.cpp \
										$(DIR_PVM)/decoders/speex/pvmsourcefactoryspeex.cpp \
										$(DIR_PVM)/decoders/speex/pvmvoicesourcespeex.cpp \
										$(DIR_PVM)/decoders/speex/pvmvoicespeex.cpp \
										$(DIR_PVM)/decoders/wav/pvmdatasourcewav.cpp \
										$(DIR_PVM)/decoders/wav/pvmsourcefactorywav.cpp \
										$(DIR_PVM)/decoders/wav/pvmvoicesourcewav.cpp \
										$(DIR_PVM)/decoders/wav/pvmvoicewav.cpp \
										$(DIR_PVM)/decoders/wav/pvmvoiceimaadpcmwav.cpp \
										$(DIR_PVM)/helpers/pvmhelpers.cpp \
										$(DIR_PVM)/helpers/pvminstreamhelpers.cpp \
										$(DIR_PVM)/helpers/pvmoutstreamhelpers.cpp \
										$(DIR_PVM)/softwaremixer/pvmresamplerint.cpp \
										$(DIR_PVM)/softwaremixer/pvmsoftmixerfastint.cpp \
										$(DIR_PVM)/sys/posix/pvmstrings.cpp \
										$(DIR_PVM)/sys/posix/pvmsystem.cpp \
										$(DIR_PVM)/sys/android/pvmandroidesystem.cpp \
										$(DIR_PVM)/pvmdriver.cpp \
										$(DIR_PVM)/drivers/pvmdriver_softmix.cpp \
										$(DIR_PVM)/drivers/pvmdriver_rawwriter.cpp \
										$(DIR_PVM)/drivers/pvmdriver_android_audiotrack.cpp

LOCAL_C_INCLUDES	:=	$(LOCAL_PATH)/$(DIR_SRC) \
											$(LOCAL_PATH)/../../../../common/src \
											$(LOCAL_PATH)/../../../../Tremor/include \
											$(LOCAL_PATH)/../../../../speex/include \
											$(LOCAL_PATH)/../../../../ogg/include

LOCAL_CFLAGS	+=	-fexceptions -frtti -Wno-psabi\
									-DPVM_USE_TREMOR -DPVM_STATICLIB -DPVM_USE_TREMOR \
									-DPVM_STATICLIB -DPVM_USE_SPINLOCK_AS_CRITICAL -DMSPACES \
									-DONLY_MSPACES -DNO_MALLINFO -DUSE_DL_PREFIX \
									-DDL_MALLOC_HAVE_CONFIG_H


LOCAL_EXPORT_C_INCLUDES	:=	$(LOCAL_PATH)/$(DIR_SRC) \
														$(LOCAL_PATH)/$(DIR_SRC)/pvm
LOCAL_EXPORT_CFLAGS	:=	-fexceptions -frtti -Wno-psabi

include $(BUILD_STATIC_LIBRARY)
